﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ScrappyDB.Attributes;

namespace ScrappyDB.Membership
{
 

    /// <summary>
    /// Gets or sets the value of the System.Configuration.SettingsProperty object.
    /// </summary>
    /// <returns>
    /// The value of the System.Configuration.SettingsProperty object. 
    /// 
    /// When this value is set, the System.Configuration.SettingsPropertyValue.IsDirty property is set to true and 
    /// System.Configuration.SettingsPropertyValue.UsingDefaultValue is set to false.  
    /// 
    /// When a value is first accessed from the System.Configuration.SettingsPropertyValue.PropertyValue 
    /// property, and if the value was initially stored into the System.Configuration.SettingsPropertyValue 
    /// object as a serialized representation using the System.Configuration.SettingsPropertyValue.SerializedValue 
    /// property, the System.Configuration.SettingsPropertyValue.PropertyValue property will 
    /// trigger deserialization of the underlying value. 
    /// 
    /// As a side effect, the System.Configuration.SettingsPropertyValue.Deserialized property will be set to true.  
    /// If this chain of events occurs in ASP.NET, and if an error occurs during the deserialization 
    /// process, the error is logged using the health-monitoring feature of ASP.NET. By default, 
    /// this means that deserialization errors will show up in the Application Event Log when 
    /// running under ASP.NET. If this process occurs outside of ASP.NET, and if an error occurs 
    /// during deserialization, the error is suppressed, and the remainder of the logic during 
    /// deserialization occurs. 
    /// 
    /// If there is no serialized value to deserialize when the deserialization 
    /// is attempted, then System.Configuration.SettingsPropertyValue object will instead attempt to 
    /// return a default value if one was configured as defined on the associated 
    /// System.Configuration.SettingsProperty instance. In this case, if the 
    /// System.Configuration.SettingsProperty.DefaultValue property was set to either null, 
    /// or to the string "[null]", then the System.Configuration.SettingsPropertyValue object 
    /// will initialize the System.Configuration.SettingsPropertyValue.PropertyValue property 
    /// to either null for reference types, or to the default value for the associated value type. 
    /// On the other hand, if System.Configuration.SettingsProperty.DefaultValue property holds a 
    /// valid object reference or string value (other than "[null]"), then the 
    /// System.Configuration.SettingsProperty.DefaultValue property is returned instead.  
    /// 
    /// If there is no serialized value to deserialize when the deserialization is attempted, 
    /// and no default value was specified, then an empty string will be returned for string types. 
    /// 
    /// For all other types, a default instance will be returned by calling 
    /// System.Activator.CreateInstance(System.Type) — for reference types this means an attempt 
    /// will be made to create an object instance using the default constructor. If this attempt fails, 
    /// then null is returned.
    /// </returns>
    /// <exceptions>
    /// System.ArgumentException: While attempting to use the default value from the 
    /// System.Configuration.SettingsProperty.DefaultValue property, an error occurred. 
    /// Either the attempt to convert System.Configuration.SettingsProperty.DefaultValue property to a
    /// valid type failed, or the resulting value was not compatible with the type defined by 
    /// System.Configuration.SettingsProperty.PropertyType.
    /// </exceptions>

    public class UserProfileProperty : ScrappyDB.BaseClasses.SdbEntity
    {
        [ItemName]
        public Guid ProfilePropertyId { get; set; }
        public Guid UserId { get; set; }
        public string PropertyName { get; set; }
        public string PropertyValue { get; set; }

    }

    //public class ProfilePropertyType: BaseClasses.DbEntity
    //{
    //    public string Name { get; set; }
    //    public object DefaultValue { get; set; }
    //    public Type PropertyType { get; set; }
    //}
}
